package com.atmc.controller;

import com.atmc.bean.*;

import com.atmc.service.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class TheController {
    @Autowired
    BillService billService;
    @Autowired
    SupplierService supplierService;
    @Autowired
    UserService userService;
    @Autowired
    CodeService codeService;
    @Autowired
    EmailService emailService;
    //通过openFeign 远程接口调用服务
    //返回Bill集合数据
    @RequestMapping("/articletype-list")
    @ResponseBody
    public List<Bill> select(){
        List<Bill> list = billService.selectAll();
        return list;
    }
    //通过openFeign 远程接口调用服务
    //返回supplier集合数据
    @RequestMapping("/supplierList")
    @ResponseBody
    public List<Supplier> supplierList(){
//        Page<Supplier> page=new Page<>(1,5);
        List<Supplier> list = supplierService.selectAll();
        return list;
    }
    //通过openFeign 远程接口调用服务
    //返回user集合数据
    @RequestMapping("/userlist")
    @ResponseBody
    public List<User> userList(){
        List<User> list = userService.selectAll();
        return list;
    }
    //通过openFeign 远程接口调用服务
    //返回code集合数据
    @RequestMapping("/codelist")
    @ResponseBody
    public List<Code> codelist(){
        List<Code> list = codeService.selectAll();
        return list;
    }
    @RequestMapping("/emaillist")
    @ResponseBody
    public List<Email> emaillist(){
        List<Email> list = emailService.selectAll();
        return list;
    }
}
